package com.learn.factory;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // 创造宝马车
        Car car1 = CarFactory.createCar("bmw");
        car1.run();
        // 创造玛莎拉蒂车
        Car car2 = CarFactory.createCar("maserati");
        car2.run();
    }

}
